home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / djgpp / include / x11 / xrmi.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-11  |  1.5 KB  |  43 lines

  1. /* $XConsortium: XrmI.h,v 1.7 91/04/23 18:25:52 rws Exp $ */
  2. /*
  3.  
  4. Copyright 1990 by the Massachusetts Institute of Technology
  5.  
  6. Permission to use, copy, modify, distribute, and sell this software and its
  7. documentation for any purpose is hereby granted without fee, provided that
  8. the above copyright notice appear in all copies and that both that
  9. copyright notice and this permission notice appear in supporting
  10. documentation, and that the name of M.I.T. not be used in advertising or
  11. publicity pertaining to distribution of the software without specific,
  12. written prior permission.  M.I.T. makes no representations about the
  13. suitability of this software for any purpose.  It is provided "as is"
  14. without express or implied warranty.
  15.  
  16. */
  17.  
  18. /*
  19.  * Macros to abstract out reading the file, and getting its size.
  20.  *
  21.  * You may need to redefine these for various other operating systems.
  22.  */
  23.  
  24. #include    <X11/Xos.h>
  25. #include        <sys/stat.h>
  26.  
  27. #ifdef MSDOS
  28. #define OpenFile(name)         open((name), O_RDONLY | O_BINARY)
  29. #else
  30. #define OpenFile(name)         open((name), O_RDONLY)
  31. #endif
  32.  
  33. #define CloseFile(fd)           close((fd))
  34. #define ReadFile(fd,buf,size)    read((fd), (buf), (size))
  35. #define GetSizeOfFile(name,size)                    \
  36. {                                                   \
  37.     struct stat status_buffer;                      \
  38.     if ( (stat((name), &status_buffer)) == -1 )     \
  39.     size = -1;                                  \
  40.     else                                            \
  41.     size = status_buffer.st_size;               \
  42. }
  43.